MDEV-39290 mytop use invoking login as default user on Unix
authorAquila Macedo <aquilamacedo@riseup.net>
Wed, 8 Apr 2026 14:19:44 +0000 (11:19 -0300)
committerOtto Kekäläinen <otto@debian.org>
Tue, 2 Jun 2026 00:02:02 +0000 (00:02 +0000)
commitb4af08e4f7adc450e5e20ba66dc30f160d600f2b
tree50e01f782ccc4029c86f6084235fce9208bb1b71
parentb83944933ab8d556436d8f96a4984de5fe20d681
MDEV-39290 mytop use invoking login as default user on Unix

On non-Windows systems, use the invoking user's login name as the
default MariaDB username instead of hardcoding root.

Resolve the username from getpwuid($<), falling back to LOGNAME, USER,
and finally root. Keep the existing root default on Windows.

This makes mytop behave more like the mysql and mariadb clients and
avoids confusing authentication failures on systems where local socket
access is configured for the OS user rather than root.

Also update the connection error text and POD to describe the actual
default behavior.

(cherry picked from commit 14502365efa17b78281e53dd1ab883f5e298a432)

Merged in upstream branch 13.0. Debian patch can be dropped when importing
new upstream major version 13.0+.

Forwarded: https://github.com/MariaDB/server/pull/4918

Gbp-Pq: Name MDEV-39290-mytop-use-invoking-login-as-default-user-on-Un.patch
scripts/mytop.sh